<html>
<head><meta charset="utf-8"><title>associated types in UFCS calls via HIR · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html">associated types in UFCS calls via HIR</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="192986434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192986434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192986434">(Apr 06 2020 at 00:58)</a>:</h4>
<p>Does anyone know what I'm doing wrong here trying to create a call to Future::poll in HIR? <a href="https://github.com/rust-lang/rust/commit/5eb7eed0300eaeca84aeab57b61c40369375874f" title="https://github.com/rust-lang/rust/commit/5eb7eed0300eaeca84aeab57b61c40369375874f">https://github.com/rust-lang/rust/commit/5eb7eed0300eaeca84aeab57b61c40369375874f</a></p>
<p>The synthesized code hits an error saying that the associated Output type needs to be specified:</p>
<div class="codehilite"><pre><span></span>error[E0191]: the value of the associated type `Output` (from trait `std::future::Future`) must be specified
  --&gt; /home/sfackler/code/rust/src/test/ui/async-await/async-with-closure.rs:21:5
   |
LL |     get_future(messages).await;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated type: `get_future(messages).await&lt;Output = Type&gt;`
</pre></div>



<a name="192986977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192986977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192986977">(Apr 06 2020 at 01:12)</a>:</h4>
<p><span class="user-mention" data-user-id="243558">@Steven Fackler</span> are you creating <code>&lt;Future&gt;::poll</code> or <code>Future::poll</code>?</p>



<a name="192986983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192986983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192986983">(Apr 06 2020 at 01:13)</a>:</h4>
<p>the former isn't what it looks like :P</p>



<a name="192986992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192986992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192986992">(Apr 06 2020 at 01:13)</a>:</h4>
<p>it's <code>&lt;dyn Future&gt;::poll</code> which is why it wants the associated type specified</p>



<a name="192987001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987001">(Apr 06 2020 at 01:13)</a>:</h4>
<p>Yeah, I want to be making <code>Future::poll</code></p>



<a name="192987012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987012">(Apr 06 2020 at 01:13)</a>:</h4>
<p><code>Future</code> in <code>Future::poll</code> is like a module, not like a type</p>



<a name="192987055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987055">(Apr 06 2020 at 01:14)</a>:</h4>
<p>ah right I don't want QPath::TypeRelative</p>



<a name="192987056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987056">(Apr 06 2020 at 01:14)</a>:</h4>
<p>so it's a regular path, <em>not</em> qualified at all (from the point of view of the compiler)</p>



<a name="192987057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987057">(Apr 06 2020 at 01:14)</a>:</h4>
<p>right</p>



<a name="192987082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987082">(Apr 06 2020 at 01:15)</a>:</h4>
<p>look at how <code>Iterator::next</code> is called for <code>for</code> loops and copy that, I guess?</p>



<a name="192987088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987088">(Apr 06 2020 at 01:15)</a>:</h4>
<p>ah yeah good call</p>



<a name="192987089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987089">(Apr 06 2020 at 01:15)</a>:</h4>
<p>thanks!</p>



<a name="192987153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987153">(Apr 06 2020 at 01:16)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/librustc_ast_lowering/expr.rs#L1091" title="https://github.com/rust-lang/rust/blob/master/src/librustc_ast_lowering/expr.rs#L1091">https://github.com/rust-lang/rust/blob/master/src/librustc_ast_lowering/expr.rs#L1091</a></p>



<a name="192987156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/associated%20types%20in%20UFCS%20calls%20via%20HIR/near/192987156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/associated.20types.20in.20UFCS.20calls.20via.20HIR.html#192987156">(Apr 06 2020 at 01:16)</a>:</h4>
<p>yeah so it just looks like a module path</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>